package com.ylkj.ylboss.rest.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ylkj.common.base.ResultData;
import com.ylkj.common.base.ReturnParamData;
import com.ylkj.ylboss.rest.service.UploadImRecordService;
import com.ylkj.ylboss.rest.vo.ImRecordVO;

@Component
@RequestMapping
public class UploadAnswerInfo {
	@Autowired
	private UploadImRecordService uploadImRecordService;
	
	@RequestMapping(method = RequestMethod.POST, value="/uploadImRecord")
	@ResponseBody
	public ResultData uploadImRecord(@RequestBody ImRecordVO imRecordVO) {
		ResultData rd = null;
		try {
			rd = uploadImRecordService.saveImRecord(imRecordVO);
		} catch (Exception e) {
			rd = new ResultData();
			rd.setCode(ReturnParamData.ReturnParam.SYSTEMEXCEPTION.getCode());
			rd.setMessage(ReturnParamData.ReturnParam.SYSTEMEXCEPTION.getMes());
		}
		return rd;
	}
}
